package com.blindBox.back.exception;


import com.blindBox.back.commonResult.MsgBackToFront;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//集中处理controller层的异常
@RestControllerAdvice
public class AllException
{
    @ExceptionHandler({Exception.class})
    public MsgBackToFront handleArithException(Exception e)//这里会自动封装捕获到的异常
    {
        e.printStackTrace();
        return new MsgBackToFront(null,MsgBackToFront.EXCEPTION_ERROR);
    }
}
